Skip to content

Kibana service: published through a Domain (S-024-8) - #610

Merged
shipmill-romamo[bot] merged 2 commits into
mainfrom
feat/573-kibana-domain
Nov 24, 2026
Merged

shipmill-romamo[bot] merged 2 commits into
mainfrom
feat/573-kibana-domain

Conversation

@shipmill-romamo

Copy link
Copy Markdown
Contributor

Plan

  • Serves: G-1, G-3
  • Files: engine/ansible/roles/cloudfall_kibana/tasks/main.yml, engine/ansible/roles/cloudfall_kibana/templates/kibana.yml.j2, engine/ansible/roles/cloudfall_kibana/defaults/main.yml, engine/ansible/roles/cloudfall_kibana/meta/argument_specs.yml, engine/ansible/playbooks/services.yml, engine/tests/test_s024_kibana_role.py, engine/tests/test_s024_8_kibana_domain.py (new), changelog.d/573-kibana-domain.md
  • Order: services.yml hands the role the Domain its kibana.domain names, from the server's own cloudfall_domains (the Domain's proxy server is the Kibana server, which validation already requires); the role replaces its refusal of a declared domain with a refusal of a Domain the server does not hold, before any change; kibana.yml gets server.publicBaseUrl: https://<primaryName> and xpack.security.secureCookies: true for a published Kibana, and stays as it is without domain; the certificate and the nginx site in front of the loopback listener stay the existing Domain apply path (domains.yml, cloudfall_nginx_site), with no second mechanism
  • Proof: S-024-8 (test_s024_8_... in a new engine/tests/test_s024_8_kibana_domain.py, kept apart from the role's test file that Kibana service: view and edit access for declared users (S-024-6, S-024-7) #572 also edits: the rendered kibana.yml of a published Kibana, the Domain services.yml hands the role, the refusal of a Domain the server does not hold, and the spec's Domain rendered by cloudfall_nginx_site in front of the loopback listener with the certificate of its name); the existing S-024-3 test keeps the undomained kibana.yml unchanged
  • Tests changed: engine/tests/test_s024_kibana_role.py: its S-024-4 test asserted the refusal of a declared domain, which this issue lifts

Summary

Publishes a Kibana service through the existing Domain its kibana.domain names (S-024-8). #598 refused a declared domain in the role; this lifts that refusal.

  • services.yml hands cloudfall_kibana a new cloudfall_kibana_domain: the Domain of that id among the server's own cloudfall_domains (the Domain's proxy server is the Kibana server, which config validate already requires with service_kibana_domain)
  • kibana.yml of a published Kibana gets server.publicBaseUrl: "https://<primaryName>" (no trailing slash) and xpack.security.secureCookies: true. Without domain the file is byte-for-byte what it was
  • Kibana keeps listening on loopback; the role's own calls (status, login redirect, listener check) still use the loopback URL
  • The certificate and nginx site are the existing Domain apply path (cloudfall domains apply -> domains.yml -> cloudfall_nginx_site), whose site already proxies with Host and X-Forwarded-Proto. No second nginx or TLS mechanism
  • The role's refusal Refuse a Domain this server does not hold for Kibana (still before any task that changes the host) stops a converge whose Domain is not on the server, not proxying to the Kibana port, not tls.mode: required, or has routes: a guard behind validation, not a new rule
  • An undeclared Domain is refused at validation already (resource_reference_missing, from Kibana service: declaration and validation (S-024-1, S-024-2, S-024-12) #567)

Test notes

  • uv run pytest engine/tests/test_s024_8_kibana_domain.py engine/tests/test_s024_kibana_role.py: 23 passed
  • uv run ruff check ., uv run mypy, ANSIBLE_CONFIG=engine/ansible/ansible.cfg uv run ansible-lint engine/ansible: clean
  • specs.py coverage --spec 024 lists four S-024-8 tests
  • The full suite is left to CI, including the converge job
  • Not verified here, needs a live host: a browser login through https://kibana.example.test with a real certificate, the Secure flag on Kibana's sid cookie as the browser sees it, and generated links (share URLs) starting with the public address. The tests prove the settings Kibana is given and the nginx site rendered in front of it, not Kibana's answers

Fixes #573

🤖 Generated with Claude Code

shipmill-romamo Bot and others added 2 commits November 24, 2026 11:04
A Kibana service that declares kibana.domain was refused by the role until
this issue. services.yml now hands the cloudfall_kibana role the Domain from
the server's own Domains (validation already requires the Domain's proxy
server to be the Kibana server), and the role writes
server.publicBaseUrl: https://<primaryName> and
xpack.security.secureCookies: true, so the links Kibana generates use the
public address and its session cookie travels over HTTPS only.

Kibana keeps listening on loopback. The certificate and the nginx site in
front of it stay the existing Domain apply path (domains.yml and
cloudfall_nginx_site); no second nginx or TLS mechanism. The role now
refuses, before any change, a domain its server does not hold proxying to
the Kibana port with tls.mode required and no routes. An undomained Kibana
renders the same kibana.yml as before.

Fixes #573

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Part of #573: a declared domain now converges, so the #569 entry
no longer says it is refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@shipmill-romamo shipmill-romamo Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: MERGE at 36abe0b. Reviewed 0821d58; one fix commit since, 36abe0b, which drops the stale "a declared domain is refused" clause from changelog.d/569-kibana-converge.md (was F-1).

Checks: ruff, mypy, ansible-lint (CI config) clean; touched tests 23 passed. specs.py coverage --spec 024 lists four tests for S-024-8; its exit 1 is for criteria other issues build.

Verified: Kibana stays on loopback; server.publicBaseUrl is exactly https://<primaryName>; secureCookies only with a domain, an undomained kibana.yml unchanged. The existing domain-site.conf.j2 sends Host and X-Forwarded-Proto, proxies to the Domain's upstream, and redirects plain HTTP. The role's refusals are a subset of config validate's, so validate never accepts what converge refuses. The rewritten S-024-4 test still proves every refusal precedes the first change. Not checking that the Domain was applied is in line with the spec, which makes the applied Domain a precondition of S-024-8.

Unverified live: a login through the domain, the certificate, the Secure cookie in a browser, generated links (rendered config only).

Notes (not blocking):

  • F-2 (nit): the S-024-8 tests check rendered settings only (Q-1); the PR says so

History: H-1 consistent; the rest unrelated; #611 and #597 also edit services.yml.

@shipmill-romamo
shipmill-romamo Bot merged commit 7eb031f into main Nov 24, 2026
3 checks passed
@shipmill-romamo
shipmill-romamo Bot deleted the feat/573-kibana-domain branch November 24, 2026 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kibana service: published through a Domain (S-024-8)

0 participants